package com.google.gwt.maps.v3.client.streetview;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.maps.v3.client.base.HasLatLng;
import com.google.gwt.maps.v3.client.streetview.impl.StreetViewServiceImpl;

public class StreetViewService implements HasStreetViewService {
  
  private static final StreetViewServiceImpl impl = StreetViewServiceImpl.impl;
  
  private final JavaScriptObject jso;
  
  public StreetViewService(final JavaScriptObject jso) {
    this.jso = jso;
  }
  
  public StreetViewService() {
    this(impl.construct());
  }

  @Override
  public void getPanoramaById(String panoId, StreetViewServiceCallback callback) {
    impl.getPanoramaById(jso, panoId, callback);
  }

  @Override
  public void getPanoramaByLocation(HasLatLng latLng, double radius,
      StreetViewServiceCallback callback) {
    impl.getPanoramaByLocation(jso, latLng.getJso(), radius, callback);
  }

  @Override
  public JavaScriptObject getJso() {
    return jso;
  }

}
